package com.ynny.demo02;

import com.sun.tools.javac.Main;

public class Person {
    private int age;

    public void setAge(int age) {
        if (age < 0 || age > 120) {
            System.out.println("年龄不合法");
        } else {
            this.age = age;
            System.out.println("年龄合法");
        }
    }
    }

